import { createSlice } from '@reduxjs/toolkit'
const scene = createSlice({
    name: 'scene',
    initialState: {
        userName:"皮卡丘",
        age:'648'
    },
    reducers: {
        //同步方法
        setName(state,action){
            console.log(state,action);
            
            state.userName = action.payload;
        }
    }
})

export default scene.reducer
export const { setName } = scene.actions